#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int n, m;
	cin >> n >> m;
	if(max(n, m) == min(n, m) + 1) {
		cout << (n + m ) << endl;
	} else {
		int t = min(n, m);
		
		cout << (t + min(t + 1, max(n, m))) << endl;
	}
	return 0;
}

